package com.bana.fvs.app.util;

import com.bana.fvs.app.mvp.ConstantsValue;

import java.util.HashMap;

/**
 * Author : yanftch
 * Date : 2018/2/17
 * Time : 20:21
 * Desc : 通用工具类
 */

public class CommonUtils {
    private static long FIRST_TIME = 0;

    /**
     * 防双击事件
     */
    public static boolean isFastDoubleClick() {
        long currentTime = System.currentTimeMillis();
        long mTime_step = currentTime - FIRST_TIME;
        if (mTime_step > 0 && mTime_step < 500) {
            return true;
        }
        FIRST_TIME = currentTime;
        return false;
    }

    public static HashMap<String,Object> getParams(String token){
        HashMap<String,Object> map = new HashMap<>();
        map.put(ConstantsValue.TOKEN,token);
        return map;
    }
}
